<template>
  <!-- // 增删改 按钮
      comMb8Button: [
        {
          label: '增加',
          type: 'primary',
          icon: 'el-icon-plus',
          btnId: '',
          vHasPermi: 'system:role:add',
        },
        {
          label: '修改',
          type: 'success',
          icon: 'el-icon-edit',
          btnId: '',
          vHasPermi: 'system:role:edit',
        },
      ], -->
  <el-row :gutter="10" class="mb8">
    <el-col :span="1.5">
      <!-- <el-button
        v-for="(item, index) in config"
        :key="index"
        :type="item.type"
        plain
        :icon="item.icon"
        size="mini"
        @click="handleClick(item.type, rowId, item.label)"
        :v-hasPermi="[item.vHasPermi]"
        >{{ item.label }}</el-button
      > -->

      <!-- handleClick传值后续将使用item.btnId，item.type将会在之后的更新中取消 -->
      <el-button
        v-for="(item, index) in config"
        :key="index"
        :type="item.type"
        plain
        :icon="item.icon"
        size="mini"
        :disabled="item.disabled"
        @click="handleClick(item.type, item.btnId)"
        :v-hasPermi="[item.vHasPermi]"
        >{{ item.label }}</el-button
      >
    </el-col>

    <!-- <right-toolbar :showSearch.sync="showSearch"
                   @queryTable="getList"></right-toolbar> -->
  </el-row>
</template>

<script>
export default {
  props: {
    config: {
      type: Array,
    },
  },
  data() {
    return {};
  },

  methods: {
    handleClick(type, btnId) {
      console.log("handle:", type, btnId);
      this.$emit("handle", type, btnId);
    },
  },
};
</script>

<style lang="scss" scoped>
</style>